﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:Phone7.Fx.Controls" xmlns:system="clr-namespace:System;assembly=mscorlib">

  <Style TargetType="Controls:LoadingIndicator">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Controls:LoadingIndicator">
          <Grid CacheMode="BitmapCache" x:Name="GridRoot" Background="{TemplateBinding Background}">
            <Ellipse CacheMode="BitmapCache" x:Name="Element0" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element1" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element2" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element3" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element4" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element5" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element6" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element7" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element8" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element9" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element10" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
            <Ellipse CacheMode="BitmapCache" x:Name="Element11" Width="12" Height="12" Fill="{StaticResource PhoneAccentBrush}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


  <!--********Animating Frame********-->
  <Style TargetType="Controls:AnimatingFrame">
    <Setter Property="IsTabStop" Value="True" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="Transition" Value="SwingIn" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Controls:AnimatingFrame">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="PresentationStates">
                <VisualState x:Name="DefaultTransition">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames
                      BeginTime="00:00:00"
                      Storyboard.TargetName="CurrentContentClone"
                      Storyboard.TargetProperty="(UIElement.Opacity)">
                      <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames
                      BeginTime="00:00:00"
                      Storyboard.TargetName="PreviousContentClone"
                      Storyboard.TargetProperty="(UIElement.Opacity)">
                      <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Normal">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames
                      BeginTime="00:00:00"
                      Storyboard.TargetName="PreviousContentClone"
                      Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames
                      BeginTime="00:00:00"
                      Storyboard.TargetName="CurrentContentClone"
                      Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames
                      BeginTime="00:00:00"
                      Storyboard.TargetName="CurrentContentPresentationSite"
                      Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>

                <VisualState x:Name="PreCloned">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames
                      BeginTime="00:00:00"
                      Storyboard.TargetName="CurrentContentPresentationSite"
                      Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames
                      BeginTime="00:00:00"
                      Storyboard.TargetName="CurrentContentClone"
                      Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>

                <VisualState x:Name="Cloned">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames
                      BeginTime="00:00:00"
                      Storyboard.TargetName="CurrentContentPresentationSite"
                      Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>

                <VisualState x:Name="SlideUp">
                  <Storyboard>
                    <DoubleAnimation Duration="0:0:0.7" From="800" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="CurrentContentClone">
                      <DoubleAnimation.EasingFunction>
                        <CircleEase EasingMode="EaseOut"/>
                      </DoubleAnimation.EasingFunction>
                      <!--<DoubleAnimation.EasingFunction>
                                                <QuinticEase EasingMode="EaseOut"/>
                                            </DoubleAnimation.EasingFunction>-->
                    </DoubleAnimation>
                  </Storyboard>
                </VisualState>

                <VisualState x:Name="SlideDown">
                  <Storyboard>
                    <DoubleAnimation Duration="0:0:0.7" From="0" To="800" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="PreviousContentClone">
                      <!--<DoubleAnimation.EasingFunction>
                                                <QuinticEase EasingMode="EaseIn"/>
                                            </DoubleAnimation.EasingFunction>-->
                      <DoubleAnimation.EasingFunction>
                        <CircleEase EasingMode="EaseIn"/>
                      </DoubleAnimation.EasingFunction>
                    </DoubleAnimation>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)" Storyboard.TargetName="PreviousContentClone">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <system:Int32>99</system:Int32>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>

                <VisualState x:Name="FlipToBack">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)" Storyboard.TargetName="PreviousContentClone">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <system:Int32>99</system:Int32>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="90">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <QuarticEase EasingMode="EaseIn"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetZ)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-300">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <QuarticEase EasingMode="EaseIn"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                      <DiscreteObjectKeyFrame KeyTime="00:00:00.5000000">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="270"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:01.1000000" Value="360">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <QuinticEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetZ)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-300"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:01.1000000" Value="0">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <QuinticEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>

                <VisualState x:Name="FlipToFront">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)" Storyboard.TargetName="PreviousContentClone">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <system:Int32>99</system:Int32>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-90">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <QuarticEase EasingMode="EaseIn"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetZ)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-300">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <QuarticEase EasingMode="EaseIn"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                      <DiscreteObjectKeyFrame KeyTime="00:00:00.5000000">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-270"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:01.1000000" Value="-360">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <QuinticEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetZ)">
                      <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-300"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:01.1000000" Value="0">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <QuinticEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>

                <VisualState x:Name="SwingIn">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)" Storyboard.TargetName="PreviousContentClone">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <system:Int32>99</system:Int32>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="PreviousContentClone">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <system:Int32>0</system:Int32>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="CurrentContentClone">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <system:Int32>0</system:Int32>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PreviousContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                      <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:01" Value="100">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <CircleEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PreviousContentClone" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                      <DiscreteObjectKeyFrame KeyTime="00:00:01">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                      <DiscreteObjectKeyFrame KeyTime="00:00:00.3">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                      <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="-120"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:01.3" Value="0">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <CircleEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>

                <VisualState x:Name="SwingOut">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="PreviousContentClone">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <system:Int32>0</system:Int32>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="CurrentContentClone">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <system:Int32>0</system:Int32>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PreviousContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                      <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:01" Value="-120">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <CircleEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PreviousContentClone" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                      <DiscreteObjectKeyFrame KeyTime="00:00:0.9">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                      <DiscreteObjectKeyFrame KeyTime="00:00:00.3">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="CurrentContentClone" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                      <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="100"/>
                      <EasingDoubleKeyFrame KeyTime="00:00:01.3" Value="0">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <CircleEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>

              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <ContentPresenter
                CacheMode="BitmapCache"
                x:Name="CurrentContentPresentationSite"
                Visibility="Collapsed"
                Content="{x:Null}"
                ContentTemplate="{TemplateBinding ContentTemplate}"
                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RenderTransformOrigin="0.5,0.5">
              <ContentPresenter.RenderTransform>
                <TransformGroup>
                  <ScaleTransform/>
                  <SkewTransform/>
                  <RotateTransform/>
                  <TranslateTransform/>
                </TransformGroup>
              </ContentPresenter.RenderTransform>
              <ContentPresenter.Projection>
                <PlaneProjection />
              </ContentPresenter.Projection>
            </ContentPresenter>

            <Image
                CacheMode="BitmapCache"
                x:Name="PreviousContentClone"
                Stretch="None"
                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RenderTransformOrigin="0.5,0.5">
              <Image.RenderTransform>
                <TransformGroup>
                  <ScaleTransform/>
                  <SkewTransform/>
                  <RotateTransform/>
                  <TranslateTransform/>
                </TransformGroup>
              </Image.RenderTransform>
              <Image.Projection>
                <PlaneProjection />
              </Image.Projection>
            </Image>

            <Image
                CacheMode="BitmapCache"
                x:Name="CurrentContentClone"
                Stretch="None"
                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RenderTransformOrigin="0.5,0.5">
              <Image.RenderTransform>
                <TransformGroup>
                  <ScaleTransform/>
                  <SkewTransform/>
                  <RotateTransform/>
                  <TranslateTransform/>
                </TransformGroup>
              </Image.RenderTransform>
              <Image.Projection>
                <PlaneProjection />
              </Image.Projection>
            </Image>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="Controls:WatermarkedTextBox" >
    <Setter Property="WatermarkBrush" Value="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
    <Setter Property="Watermark" Value="enter text" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Controls:WatermarkedTextBox">
          <Grid x:Name="Root">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="WatermarkStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="00:00:00.2" />
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Normal">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001"
                                                   Storyboard.TargetName="_watermarkGrid"
                                                   Storyboard.TargetProperty="(UIElement.Opacity)">
                      <LinearDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Watermarked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001"
                                                   Storyboard.TargetName="_watermarkGrid"
                                                   Storyboard.TargetProperty="(UIElement.Opacity)">
                      <LinearDoubleKeyFrame KeyTime="00:00:00" Value="0.9" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0" />
                  <VisualTransition To="Focused" GeneratedDuration="0:0:0.1" />
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Unfocused" />
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimation To="0.0"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     Storyboard.TargetName="_watermark"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <TextBox x:Name="_text"
                     Text="{TemplateBinding Text}"
                     TextWrapping="{TemplateBinding TextWrapping}"
                     InputScope="{TemplateBinding InputScope}"
                                 />
            <Grid x:Name="_watermarkGrid" Margin="6,6,0,0">
              <TextBlock
                  Margin="{StaticResource PhoneTouchTargetOverhang}"
                  Style="{StaticResource PhoneTextNormalStyle}"
                  FontFamily="{StaticResource PhoneFontFamilyNormal}"
                  FontSize="{StaticResource PhoneFontSizeMediumLarge}"
                  x:Name="_watermark"
                  IsHitTestVisible="False"
                  TextWrapping="Wrap"
                  Foreground="{TemplateBinding WatermarkBrush}"
                  Text="{TemplateBinding Watermark}"
                  VerticalAlignment="Top"
                  HorizontalAlignment="Left" />
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


</ResourceDictionary>
